#pragma once

namespace CO { namespace SpiFoundation { namespace RoomFW {

//
// Skeleton class for testing an ActiveObject.
//
class RemoteBindingTestSuite : public Test::Suite
{
public:
	RemoteBindingTestSuite();
	~RemoteBindingTestSuite();

protected:
	virtual void setup();
	virtual void tear_down();

private:

	static const DWORD DWait = 2000; // Default to 2 second wait for anything.

	//
	// Support methods.
	//
	BindingSP bindPortal(EventPortal& portal, const char* portName);
	bool verifySend(EventPortal& portal, size_t responseCount);
	bool verifyReply(EventPortal& portal, size_t responseCount);
	bool verifyInvoke(EventPortal& portal, size_t responseCount);
	IEchoServerSP bindServer();
	bool startRemoteServer(const char* name, int port);
	bool bindRemoteServer(const char* serverName, const char* clientName);

	//
	// Test methods.
	//
	void BindSendInvoke();
	void LoopTest();
	void MultipleServer();

	//
	// Initialization flag and error message because TEST_ASSERT only useful
	//	in test case methods added by TEST_ADD.
	//
	bool initialized_;
	std::string errorMessage_;

	//
	// Additional test variables.
	//
	SimpleEvent serverStopEvent_;
	std::list<SimpleChildProcessSP> serverProcess_;

};

}}}
